/**
 * 
 */
package com.gragra.sampling.annealingSchedules;
import com.gragra.sampling.Annealing;
/**
 * @author Christoph Teichmann
 * 30.09.2013
 */
public class LinearAnnealingFromMaxToMin implements Annealing
{
	/**
	 * 
	 */
	private final double add;
	/**
	 * 
	 */
	private final double min;
	/**
	 * 
	 */
	private final double max;
	/**
	 * 
	 * @param annealMax
	 * @param annealMin
	 * @param annealStepSize
	 */
	public LinearAnnealingFromMaxToMin(double annealMax, double annealMin,
			double annealStepSize)
	{
		this.add = annealStepSize;
		this.min = annealMin;
		this.max = annealMax;
	}
	/* (non-Javadoc)
	 * @see com.gragra.sampling.Annealing#getBurnInAnnealing(int)
	 */
	@Override
	public double getBurnInAnnealing(int i)
	{
		double d = (max-(i*add));
		d = Math.max(min, d);
		return 1.0/d;
	}
	/* (non-Javadoc)
	 * @see com.gragra.sampling.Annealing#getSamplingAnnealing(int)
	 */
	@Override
	public double getSamplingAnnealing(int i)
	{
		double d = (max-(i*add));
		d = Math.max(min, d);
		return 1.0/d;
	}
	/* (non-Javadoc)
	 * @see com.gragra.sampling.Annealing#reduceAnnealingBurnIn()
	 */
	@Override
	public void reduceAnnealingBurnIn()
	{}
	/* (non-Javadoc)
	 * @see com.gragra.sampling.Annealing#reduceAnnealingSampling()
	 */
	@Override
	public void reduceAnnealingSampling()
	{}
}